﻿//https://leetcode.cn/problems/first-unique-character-in-a-string/

class Solution {
public:
    int firstUniqChar(string s)
    {
        int hash[128] = { 0 };
        for (auto e : s)
        {
            hash[e]++;
        }
        for (int i = 0; i < s.size(); i++)
        {
            if (hash[s[i]] == 1)
            {
                return i;
            }
        }

        return -1;

    }
};